<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!-- Los import -->
<%@page import="blancosMikel.controller.beans.contabilidadBeans"%>
<%@page import="blancosMikel.model.dao.contabilidadDAO"%>
<%@page import="java.util.LinkedList"%>
<%@page import="blancosMikel.model.dao.rolesDAO"%>
<%@page import="blancosMikel.controller.beans.rolesBeans"%>
<%@ page language="java"%>
<%@ page session="true"%>

<%@page import="blancosMikel.controller.beans.usuariosBeans"%>
<%@page import="blancosMikel.model.dao.usuariosDAO"%>

<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Calendar"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel='stylesheet' href='CSS/sigaabm.css' type='text/css' />
<link rel='stylesheet' href='CSS/efectos.css' type='text/css' />
<SCRIPT type=text/javascript src="JS/login.js"></SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>BLANCOS MIKEL</title>
</head>
<body>
<form id="volver" action='intranet' method='post'>
	<input type='hidden' name='dispatch' value='3' />
</form>
<div class='menu' align='right'>
		<table width='100%'>
			<td align='left' style='color: white'>SIGAABM</td>
			<td align='right'>
				<ul id='menu'>					
					<li><a href="SEGURIDAD/singOut.jsp">Cerrar Sesion</a></li>
					<li><a href='javascript:;' onclick="document.getElementById('volver').submit();">Volver</a></li>
				</ul>
			</td>
		</table>
	</div>
	<%
		HttpSession sesion = request.getSession();
		if (sesion.getAttribute("sesion") == null) {
			sesion.setAttribute("mensaje", "Acceso denegado favor de iniciar sesion!");
			response.sendRedirect("loginErrors");
		}else{
			usuariosBeans usuario = (usuariosBeans) request.getSession().getAttribute("sesion");
	%>
<!-- body -->
<table class="bodyIntranet">
<tr>
	<td width="300">
		<table>
		<tr>
			<td height="150"><img src="IMG/logo.PNG" width="200" height="100" /></td>
		</tr>
		<tr>
			<td height="50"><h5><small>Bienvidenid@</small><br> <br>
								<%
									out.println(usuario.getNombreCompleto());
									out.println("<br>");
									out.println(usuario.getRol());
									out.println("<br>");
									out.println(usuario.getEmail());
									out.println("<br>");
								%>
							</h5>
			</td>
		</tr>
		<tr>
			<td>
				<%
						if (usuario.getRol().equals("Administrador") || usuario.getRol().equals("Root")) {
						%>
							<%@ include file='../menuRoot.jsp' %>
						<% 
						} else {
						%>
							<%@ include file='../menuClientes.jsp' %>
						<%
						}
						%>
						
			</td>
		</tr>
		</table>
	</td>
		<td align="left">
		<form action="saldosSVR" name="buscu" method="post">
		<input type='hidden' name='dispatch' value='3' />
		<label><h3> Buscar Registro Contable</h3></label>
		<input name="busqueda" type="text"/>
		<input name="accesar" type="submit" value="Buscar"/>
		</form>
			<table id="customers">
				<tr>
					<th>Fecha</th>
					<th>Activo</th>
					<th>Pasivo</th>
					<th>Capital</th>
				</tr>
				<%
					ArrayList<contabilidadBeans> obtener = (ArrayList) request.getSession().getAttribute("catSaldo");
					if(obtener.isEmpty()){
						out.println("No existe ningun registro contable por el momento");
					}else{
						for (contabilidadBeans bean : obtener){
							out.println("<tr class='alt'>");
							out.println("<td>");
							out.println(bean.getFecha());
							out.println("</td>");
							out.println("<td>");
							out.println(bean.getActivo());
							out.println("</td>");
							out.println("<td>");
							out.println(bean.getPasivo());
							out.println("</td>");
							out.println("<td>");
							out.println(bean.getCapital());
							out.println("</td>");
							out.println("<td align='center'>");
							out.println("<a href='contabilidad.jsp?id=");
							out.println(bean.getId_contabilidad());
							out.println("'>");
							out.println("");
						}
					}
						%>
				</table>
				</td>
	</tr>
<% } %>
</body>
</html>